/**
 * @param {number[]} nums1
 * @param {number[]} nums2
 * @return {number[]}
 */
var intersection = function(nums1, nums2) {
    let newNums = [];
    for(let i = 0;i<nums1.length;i++){
        if(nums2.includes(nums1[i]) && !newNums.includes(nums1[i])){
            newNums.push(nums1[i])
        }
    }
    return newNums;
};
console.log(intersection([2],[2,1]))